package org.ssi.util;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeFormatUtil {
	private static DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	public static Date parseTime(String stringDate) throws ParseException {
		String year = "20"+stringDate.substring(0,2);
		String month = stringDate.substring(2,4);
		String day = stringDate.substring(4,6);
		String hour = stringDate.substring(6,8);
		String minute = stringDate.substring(8,10);
		String second = stringDate.substring(10,12);
		
		String temp_date = year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
		return format.parse(temp_date);
	}
}
